﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHTools.Entity;
using FluentNHibernate.Mapping;

namespace NHTools.Map
{
    public class ChildTableMap : ClassMap<ChildTable>
    {
        public ChildTableMap()
        {
            Id(x => x.Id);
            Map(x => x.Name);
            Map(x => x.Value);
            //References(x => x.MyFirst)
            //.Cascade.SaveUpdate()
            //.Not.LazyLoad();

            HasManyToMany(x => x.Discounts)
                .Table("TourDiscount")
                .Cascade.SaveUpdate()
                .Not.LazyLoad()
                .AsBag();
        }
    }
}
